]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
extensionPrefs: Stop handling UUIDs on the command line
authorFlorian Müllner <fmuellner@gnome.org>
Thu, 5 Mar 2020 18:44:28 +0000 (19:44 +0100)
committerFlorian Müllner <florian.muellner@gmail.com>
Mon, 23 Mar 2020 15:39:12 +0000 (15:39 +0000)
We are jumping through quite some hoops to support showing only the
preference dialog when given a UUID on the command line.

As gnome-shell is about to stop calling out to us for the prefs dialog,
the reason for supporting this is going away, so remove all the special
handling.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1106

js/extensionPrefs/data/org.gnome.Extensions.desktop.in.in
js/extensionPrefs/js/main.js

index cd22f6adf03bd087e47e8881b3708765b673c812..588e68bb9db1b2b9eb7a6f2c32e8a31ad0063f8e 100644 (file)
@@ -4,7 +4,7 @@ Name=Extensions
 # Translators: Do NOT translate or transliterate this text (this is an icon file name)!
 Icon=@app_id@
 Comment=Configure GNOME Shell Extensions
-Exec=@bindir@/@prgname@ %u
+Exec=@bindir@/@prgname@
 DBusActivatable=true
 Categories=GNOME;GTK;
 OnlyShowIn=GNOME;
index fd8c00959328f3aca187be80f996127cfd26d1c8..b96319c87d987bd25460df0f287e6109771f939d 100644 (file)
@@ -29,12 +29,6 @@ function loadInterfaceXML(iface) {
     return null;
 }
 
-function stripPrefix(string, prefix) {
-    if (string.slice(0, prefix.length) == prefix)
-        return string.slice(prefix.length);
-    return string;
-}
-
 function toggleState(action) {
     let state = action.get_state();
     action.change_state(new GLib.Variant('b', !state.get_boolean()));
@@ -44,10 +38,7 @@ var Application = GObject.registerClass(
 class Application extends Gtk.Application {
     _init() {
         GLib.set_prgname('gnome-shell-extension-prefs');
-        super._init({
-            application_id: 'org.gnome.Extensions',
-            flags: Gio.ApplicationFlags.HANDLES_COMMAND_LINE,
-        });
+        super._init({ application_id: 'org.gnome.Extensions' });
     }
 
     get shellProxy() {
@@ -76,20 +67,6 @@ class Application extends Gtk.Application {
         this._shellProxy = new GnomeShellProxy(Gio.DBus.session, 'org.gnome.Shell', '/org/gnome/Shell');
         this._window = new ExtensionsWindow({ application: this });
     }
-
-    vfunc_command_line(commandLine) {
-        let [prgName_, uuid] = commandLine.get_arguments();
-
-        if (uuid) {
-            // Strip off "extension:///" prefix which fakes a URI, if it exists
-            uuid = stripPrefix(uuid, 'extension:///');
-
-            this._window.openPrefs(uuid);
-        } else {
-            this.activate();
-        }
-        return 0;
-    }
 });
 
 var ExtensionsWindow = GObject.registerClass({
@@ -108,8 +85,6 @@ var ExtensionsWindow = GObject.registerClass({
     _init(params) {
         super._init(params);
 
-        this._startupUuid = null;
-        this._loaded = false;
         this._prefsDialog = null;
         this._updatesCheckId = 0;
 
@@ -177,35 +152,16 @@ var ExtensionsWindow = GObject.registerClass({
     }
 
     openPrefs(uuid) {
-        if (!this._loaded)
-            this._startupUuid = uuid;
-        else if (!this._showPrefs(uuid))
-            this.present();
-    }
-
-    _showPrefs(uuid) {
         if (this._prefsDialog)
-            return false;
+            return;
 
         let row = this._findExtensionRow(uuid);
-        if (!row || !row.hasPrefs)
-            return false;
-
         this._prefsDialog = new ExtensionPrefsDialog(row);
+        this._prefsDialog.set({ transient_for: this, modal: true });
 
-        if (this.visible)
-            this._prefsDialog.set({ transient_for: this, modal: true });
-
-        this._prefsDialog.connect('destroy', () => {
-            this._prefsDialog = null;
-
-            if (!this.visible)
-                this.destroy();
-        });
+        this._prefsDialog.connect('destroy', () => (this._prefsDialog = null));
 
         this._prefsDialog.show();
-
-        return true;
     }
 
     _showAbout() {
@@ -359,11 +315,6 @@ var ExtensionsWindow = GObject.registerClass({
     _extensionsLoaded() {
         this._syncListVisibility();
         this._checkUpdates();
-
-        if (this._startupUuid)
-            this._showPrefs(this._startupUuid);
-        this._startupUuid = null;
-        this._loaded = true;
     }
 });